package com.cmcc.aregister.ui.dialog;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.cmcc.aregister.R;

public class MyInfoDialog extends MyDialog {
	private Button confirm;
	private TextView info;

	public MyInfoDialog(Context context, boolean hasButton) {
		super(context);
		setContentView(R.layout.dialog_info);

		info = (TextView) findViewById(R.id.dialog_info);
		// confirm = (Button) findViewById(R.id.dialog_confirm_btn);
		// confirm.setVisibility(View.VISIBLE);
		// confirm.setOnClickListener(new View.OnClickListener() {
		// @Override
		// public void onClick(View v) {
		// dismiss();
		// }
		// });
		handler.sendEmptyMessageDelayed(0, 2000);
	}

	public void setText(int id) {
		info.setText(id);
	}

	public void setText(String s) {
		info.setText(s);
	}

	public void setCancelClickListener(View.OnClickListener onClickListener) {
		confirm.setOnClickListener(onClickListener);
	}

	Handler handler = new Handler() {

		@Override
		public void handleMessage(Message msg) {
			dismiss();
		}

	};
}
